<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" 
    pageEncoding="utf-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="com.emip.bean.MenuDefBean" %> 
<%@ page import="com.emip.config.SysConfig" %>
<%@ page import="com.emip.service.impl.MenuDefServiceImpl" %>
<%@ page import="java.util.*" %>
<%
	List<MenuDefBean> allMenu =  SysConfig.getInstance().getMenu();
 %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<%@ include file="../header.jsp"%>
	<script type="text/javascript" src="<%=resourceBase%>customJS/common/commonFunc.js"></script>
	<script type="text/javascript" src="<%=resourceBase%>customJS/authorityFunc/rolesManagement.js"></script>
	<link rel="stylesheet" type="text/css" href="<%=resourceBase%>customCSS/tables/customTables.css">

  </head>
	<body>
		<div id="body-wrapper">&nbsp; 
			<!-- Wrapper for the radial gradient background -->

			<!-- sidebar.jsp -->
			<%@ include file="../sidebar.jsp"%>
			<div id="gridContent">
				<!-- Main Content Section with everything -->

				<!-- Page Head -->
				<h2>
					角色信息
				</h2>
				<p id="page-intro">
					对角色的管理
				</p>
				<table id="gridTable"></table>
				<div id="gridPager">
				</div>
				<div>
					<button class="right-button02" onclick="openDialog4Adding()">
						添加
					</button>
					<button class="right-button02" onclick="openDialog4Updating()">
						修改
					</button>
					<button class="right-button02" onclick="openDialog4Deleting()">
						删除
					</button>
					<button class="right-button02" onclick="showRoleMenuDef()">
						菜单关联
					</button>

				</div>
				<div id="consoleDlg">
					<div id="formContainer">
						<form id="consoleForm">
							<input type="hidden" id="selectId" />
							<table class="formTable">
								<tr>
									<th>
										<span style="color:red">*</span>角色名称：
									</th>
									<td>
										<input type="text" class="textField" id="eName" name="eName" maxlength="10"/>
									</td>
								</tr>
								<tr>
									<th>
										角色描述:
									</th>
									<td>
										<textarea rows="3" cols="1" class="textArea" id="eDescription" name="eDescription" maxlength="50"></textarea>
									</td>
								</tr>
							</table>
						</form>
					</div>
				</div>
				
			<div id="roleMenuDiv">
				<form id="roleMenuForm">
					<table id="roleMenuTb" class="customPromptTb">
						<tr>
							<th width="25%">一级菜单</th>
							<th>二级菜单</th>
						</tr>
						<%
							for(int i=0;i<allMenu.size();i++)
							{
								MenuDefBean l1_Menu = allMenu.get(i);  
							
						%>
						<tr>
							<td>
								<%= l1_Menu.getName() %>
							</td>
							<td>
								<%
									if(l1_Menu.getChildren().size()>0)
									{
										for(MenuDefBean l2_menu:l1_Menu.getChildren() )
										{
								 %>
							
								<input type="checkbox" value=<%= l2_menu.getId() %>> <%= l2_menu.getName() %> &nbsp&nbsp
									<% } %>
							
								<% } %>
							</td>
						</tr>	
						<% } %>
					</table>
				</form>
					<button class="right-button02" onclick="closeRoleMenuDef()">
						取消
					</button>
					<button class="right-button02" onclick="selectAllMenus()">
						全选
					</button>
					<button class="right-button02" onclick="setRoleMenuMap()">
						权限授权
					</button>
					
			</div>
					
			</div>
		</div>
	<script type="text/javascript">$.setCurrentMenu('2_JSGL');</script>
	</body>
</html>
